"use strict";
const db = uniCloud.database();

/**
 * 获取塔罗牌库（大阿尔克那）
 */
exports.main = async (event, context) => {
  try {
    const collection = db.collection("tarot_cards");
    const { data } = await collection.limit(1).get();
    if (Array.isArray(data) && data.length > 0) {
      return { code: 0, data: data[0] };
    }
  } catch (error) {
    // 不中断，走默认回退
  }
  return { code: 0, data: { version: 0, cards: [] } };
}; 